import requests

from pyquery import PyQuery as pq

#requests库的session对象能够帮我们跨请求保持某些参数，也会在同一个session实例发出的所有请求之间保持cookies
def getInfo(url,data=None,headers=None):
    session=requests.session()
    session.post(url,data,headers)
    response=session.get('http://www.renren.com/970000948')
    response.encoding=response.apparent_encoding
    print(response.cookies.get_dict())
    # print(response.text)

if __name__=='__main__':
    data={
        'email':'18934084265',
        'password':'litianbao8569378'
    }

    kv = {'user-agent': 'Mozilla/5.0'}
    getInfo('http://www.renren.com/970000948/profile',data,kv)
